<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>switch语句</title>
  </head>
  <body>
    <script>
      var weather = "下雨";
      switch (weather) {
        case "晴朗":
          console.log("打篮球");
          break;
        case "下雨":
          console.log("收衣服");
          break;
        case "下雪":
          console.log("堆雪人");
          break;
        default:
          console.log("学习");
          break;
      }
    </script>
  </body>
</html>
